<include file="Public/head" />

<body>
  <div class="panel admin-panel margin-top">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span> {:L("tianjia")}/{:L("bianji")}</strong></div>
    <div class="body-content">
      <form method="post" class="form-x" action="" enctype="multipart/form-data">
        <div class="form-group">
          <div class="label">
            <label>{:L("canzhuoleixing")}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="table_cate_name" value="{$info['table_cate_name']}" data-validate="required:{:L('qingshuru')}{:L('canzhuoleixing')}"/>
            <div class="tipss">如:小桌</div>
          </div>
        </div>
        <div class="form-group">
          <div class="label">
            <label>{:L("kezuorenshu")}：</label>
          </div>
          <div class="field">
            <input type="text" class="input w50" name="sit_people" value="{$info['sit_people']}"/>
            <div class="tipss">如:1-4（表示可坐1-4人）</div>
          </div>
        </div>
        <input type="hidden" name="cate_id" value="{$info['table_cate_id']}">
        <div class="form-group">
          <div class="label">
            <label></label>
          </div>
          <div class="field">
            <button class="button bg-main icon-check-square-o" type="submit"> {:L("xiugai")}</button>
          </div>
        </div>

      </form>
    </div>
  </div>
</body>
<script type="text/javascript">
//          $(document).ready(function(){
//            $("select[name='goods_type']").change(function(){
//              var typeon = $("select[name='goods_type']").val();
//              if(typeon==1){$("#mytype").show();}
//              else{$("#mytype").hide();$("#mytypeitem").hide();}
//            });
//
//            $(".mya1").click(function(){
//              var html = '<div class="form-group"> ';
//              html += '<div class="label"><label></label></div>';
//              html += '<div class="field"> ';
//              html += '<input type="text" class="Father_Title input w50" name="spec_name[]" placeholder="{:L("guigemingchen")}" data-validate="required: " />　';
//              html += ' <input type="text" class="input w50 check_item" name="item_name[]" placeholder="{:L("guigeshuxing")}" data-validate="required: " />　';
//              html += ' <a href="javascript:void(0)" class="mya1 button bg-red" onclick="itemdel(this)">{:L("shanchuguige")}</a>';
//              html += '</div></div>';
//
//              $("#mytype").append(html);
//            });
//          });

  function preview(file)
  {
    var prevDiv = document.getElementById('preview');
    if (file.files && file.files[0])
    {
      var reader = new FileReader();
      reader.onload = function(evt){
        prevDiv.innerHTML = '<img src="' + evt.target.result + '" width="100%" />';
      }
      reader.readAsDataURL(file.files[0]);
    }
    else
    {
      prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
    }
  }
  //单个删除
  function del(id,goods_id,t){
    if(confirm("{:L('shanchuxiaoxi')}")){
      var url = "{:U('goods/delpic')}";
      $.getJSON(url,{id:id,goods_id:goods_id},function (data){
        if(data.result=="true1"){$(t).remove();}
        else if(data.result=="true2"){$(t).next('input[type=hidden]').remove();$(t).remove();}
      })
    }
  }
  function itemdel(t){
    $(t).parents('.form-group').remove();
  }
  //生成表格
  function refreshOptions(){
    $("#mytypeitem").show();
    step.Creat_Table();
  }
</script>
</html>